package common;

import org.junit.Test;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

/**
 * 获取⽤键盘输⼊常⽤的两种⽅法:
 */
public class Example_Scanner {

    @Test
    public void Scanner_Test(){
        Scanner  scanner=new Scanner(System.in);
        String s = scanner.nextLine();
        System.out.println(s);
        scanner.close();
    }

    @Test
    public void ScannerBufferReader() throws IOException {
        BufferedReader bufferedInputStream=new BufferedReader(new InputStreamReader(System.in));
        String s = bufferedInputStream.readLine();
        System.out.println(s);
    }
}
